<template>
	<view class="main">
		<u-navbar back-text="" slot="center" :autoBack="true" safeAreaInsetTop placeholder>
			<view slot="center" class="leftText">完善信息</view>
		</u-navbar>
		<view class="mptop">
			<view>您的名片完善度<text>{{myCard.progress}}</text>%</view>
			<view>置顶后可前往个人中心-我的名片中继续完善</view>
		</view>
		<view class="card-info">
			<!--list start-->
			<view class="master-item">
				<view class="master-faceItem poser dis-row">
					<!--头像处理start-->
					<view class="faceItem-ico">
						<image :src="myCard.avatar"></image>
					</view>
					<!--头像处理over-->
					<!--顶部右侧标题文字开始-->
					<view class="faceText dis-clm">
						<!--置顶信息start-->
						<view class="faceText-t1 dis-row">
							<view class="master-name">{{myCard.nickName}}</view>
							<text>{{myCard.mobile}}</text>
						</view>
						<!--置顶信息over-->
						<view class="master-userinfo dis-row">
							<block v-if="!myCard.nickName">个人基本信息待完善</block>
							<block v-if="myCard.nickName">
								<text>{{myCard.gender==1?'男':'女'}}</text>
								<text v-if="myCard.age">{{myCard.age}}岁</text>
								<text v-if="myCard.nationStr">{{myCard.nationStr}}</text>
							</block>
						</view>
					</view>
					<!--顶部右侧标题文字结束-->
					<!--是否在线开始-->
					<view class="card-titlleico dis-row" @click="navigator('./EditUserInfo')">
						<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-edit.svg"></image></label>
						<text>{{myCard.nickName?'修改':'完善'}}</text>
					</view>
					<!--是否在线结束-->
				</view>
				<!--标签列表开始-->
				<view class="contacts-gouceng dis-row">
					<label>人员构成</label><text>{{myCard.staffTypeStr?myCard.staffTypeStr:''}}<text v-if="myCard.peopleNumStr">({{myCard.peopleNumStr}}人)</text></text>
					<label>工龄</label><text>{{myCard.workYear?myCard.workYear+'年':'未填'}}</text>
					<label>熟练度</label><text>{{myCard.masteryStr?myCard.masteryStr:''}}</text>
				</view>
			</view>
			<!--list over-->
			<view class="card-childName poser">
				自我介绍
				<view class="child-titlleico dis-row" @click="navigator('./introduce')">
					<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-edit.svg"></image></label>
					<text>修改</text>
				</view>
			</view>
			<view class="card-personper">{{myCard.notice?myCard.notice:"暂无介绍"}}
				<!-- <view class="audit">
					<view class="auditTitle">审核不通过</view>
					<view class="auditContent">你好，您在此处填写的自我介绍的信息，审核未通过。 请规范填写，如有疑问请联系天下工人客服</view>
				</view> -->
			</view>
			
			<view class="card-childName poser">
				找活信息
				<view class="child-titlleico dis-row" @click="navigator('./findJob')">
					<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-edit.svg"></image></label>
					<text>修改</text>
				</view>
			</view>
			<view class="child-classInfo dis-clm">
				<view class="t-text dis-row">
					<label>工种</label><text>{{strHandle(myCard.skills)}}</text>
				</view>
				<view class="t-text dis-row">
					<label>期望地点</label><text>{{strHandle(myCard.hopeAddr)}}</text>
				</view>
				<view class="t-text dis-row">
					<label>长短工</label><text>{{myCard.workType1Str?myCard.workType1Str:''}}</text>
				</view>
				<view class="t-text dis-row">
					<label>结算方式</label>
					<block>
						<text>{{myCard.settlementStr?myCard.settlementStr:'未填'}}</text>
						<text v-if="myCard.salary"> / {{myCard.salary?myCard.salary:''}}{{myCard.salaryUnitStr?myCard.salaryUnitStr:''}}</text>
					</block>
				</view>
				<view class="t-text dis-row">
					<label>找活状态</label>
					<text v-if="myCard.status==0 || !myCard.status">找活中</text>
					<text v-if="myCard.status==1">暂不找活</text>
					<text v-if="myCard.status==2">有活预定下一个</text>
				</view>
			</view>
			<block v-if="1==2">
				<view class="card-childName poser">
					找活视频
				</view>
				<view class="t-video">
					<image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/my/1.jpg"></image>
				</view>
			</block>
			<!-- <view class="audit">
				<view class="auditTitle">审核不通过</view>
				<view class="auditContent">你好，您在此处填写的自我介绍的信息，审核未通过。 请规范填写，如有疑问请联系天下工人客服</view>
			</view> -->
			<view class="card-childName poser">
				项目经验
				<view class="child-titlleico dis-row" @click="navigator('./experience')">
					<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-add.svg"></image></label>
					<text>添加</text>
				</view>
			</view>
			<view class="card-xiangmujingli" v-for="(item,index) in myCard.productHistoryList">
				<view class="card-childName poser">
					{{item.enterpriseName}}
					<view class="child-titlleico dis-row" @click="navigator('./experience?id='+item.id)">
						<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-edit.svg"></image></label>
						<text>修改</text>
					</view>
				</view>
				<view class="card-xmtext">{{item.startTime}}-{{item.endTime}}</view>
				<view class="card-jingliInfo">
					{{item.remark}}
				</view>
				<view class="audit" v-if="item.auditStatus==2">
					<view class="auditTitle">审核不通过</view>
					<view class="auditContent">{{item.auditComment?item.auditComment:''}}</view>
				</view>
			</view>
			
			<view class="card-childName poser">
				技能证书
				<view class="child-titlleico dis-row" @click="navigator('./certificate')">
					<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-add.svg"></image></label>
					<text>添加</text>
				</view>
			</view>
			
			<block v-for="(item,index) in myCard.certificateInfoList">
				<view class="zhengshu">
					<view class="contacts-zhengshu dis-row">
						<image :src="item.imgUrl"></image>
						<view class="zhengshu-text dis-clm">
							<label class="child-label">{{item.cname}}</label>
							<view class="dis-row">
								<label>获得证书时间</label><text>{{item.issueDate}}</text>
							</view>
						</view>
						<view class="certEdit" @click="navigator('./certificate?id='+item.id)">
							<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/contacts/card-edit.svg"></image></label>
							<text>修改</text>
						</view>				
					</view>
					<view class="audit" v-if="item.auditStatus==2">
						<view class="auditTitle">审核不通过</view>
						<view class="auditContent">{{item.auditComment?item.auditComment:''}}</view>
					</view>
				</view>
			</block>
		</view>
		<!--11-->
		<!--找活期望结束-->
		<view class="constacts-footer">
			<view @click="sendCard(1)">置顶发布</view>
			<view @click="sendCard(2)">发布名片</view>
		</view>
	</view>
</template>

<script>
import pop from "@/components/ming-pop/ming-blow.vue"
import Index from "@/common/index-model.js"
let index = new Index()
let that = null	
export default {
	data() {
		return {
			myCard:{}
		}
	},
	onLoad() {
		
	},
	onShow() {
		this.getCardDetail();
	},
	methods: {
		navBack() {
			index.navigate_back(1)
		},
		getCardDetail(){
			index.getPublicUserMember({},'/client/card/detail','get',res=>{
				if(res.data.code == 200 && res.data.success){
					let data=res.data.result;
					if(!data.avatar){
						data.avatar='http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/default-avatar.png';
					}
					this.myCard=data;
					console.log(data);
				}
			})
		},
		navigator(url){
			index.navigate_to(url);
		},
		sendCard(value) {
			index.show_tips('名片发布成功')
			if(value==1){
				setTimeout(()=>{
					index.redirectto('/pagesC/mpTop/index?id=' + this.myCard.userId);
				},500)
			}else{
				setTimeout(()=>{
					index.redirectto('/pages/worker/index')
				},2000)
			}
		},
		strHandle(str,char=','){
			str=index.strTrim(str,char);
			return index.strRep(str,',','、');
		}
	}
}
</script>

<style>
@import url("@/static/css/publics.css");
@import url("@/static/css/Mybusinesscardp.css");
.mptop{
	background-image: url('http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/bg4.png');
	background-size: cover;
	height: 104rpx;
	color: #fff;
	padding: 26rpx;
	overflow: hidden;
}
.mptop view:nth-child(1){
	margin-left: 196rpx;
}
.mptop view:nth-child(1) text{
	font-size: 36rpx;
	font-weight: bold;
	margin-left: 20rpx;
}
.mptop view:nth-child(2){
	margin-left: 196rpx;
	font-size: 24rpx;
}
.audit{ background: #F4F4F4; padding: 16rpx;}
.audit .auditTitle{ color: #FF5964;}
.audit .auditContent{ color: #424242; line-height: 48rpx;}

.card-personper .audit{ margin-top: 20rpx;}
.card-xiangmujingli .audit{ padding: 20rpx 0rpx; background: none; border-top: 1px solid #E5E5E5; margin-top: 20rpx;}
.zhengshu { margin-bottom: 20rpx;}
.zhengshu .contacts-zhengshu{ margin-bottom: 0rpx;}

</style>